# -----------------------------------------------------------------------------
#     G N U    M A K E   S C R I P T   S P E C I F I C A T I O N
# -----------------------------------------------------------------------------
# NAME
#
#  Makefile  -  To automate the software build,packaging and deployment repo.
#
#
#
# REVISION HISTORY
#     1/10/2014   T.J. Yang init.
#
# USAGE
#       make [gitpush|gitpull] 
#
#
#
# DESCRIPTION
# 
#
# 
# TODOs
#  1. Improve Makefile syntax.

# ---------------------------- CONSTANT DECLARATION ---------------------------
CAT=/bin/cat
ECHO=/bin/echo
PERL=/usr/bin/perl
SUDO=/usr/bin/sudo
MKDIR=/bin/mkdir
CHOWN=/usr/sbin/chown
TAR=/bin/tar
RPM=/bin/rpm
APT_GET=/usr/bin/apt-get
UNZIP=/usr/bin/unzip
YUM=/usr/bin/yum
RM=/bin/rm -rf 
SUDORM=${SUDO} ${RM} 
GIT=/usr/bin/git

# ---------------------------- VARIABLES  DECLARATION ---------------------------
TS:=`date`
LOCATION:=`uname -n -v`
all: help

help: 
	@$(ECHO) ""
	@$(ECHO) gitpull  : shortcut for git pull. 
	@$(ECHO) gitpush  : shortcut for git push origin master.
	@$(ECHO) "Example: "
	@$(ECHO) "      1. make gitpull"
	@$(ECHO) "      1. make gitpush"

clean:
	rm -rf build/* *~ 
space:
	@du -ks . 

cleansrc:
	find ${SOURCE_DIR} ${ADDON_SRC} -type f -name *.gz
gitpush:
	($(GIT) commit -a -m "makefile update at ${TS} on ${LOCATION}" )
	($(GIT) push origin master )
gitpull: 
	($(GIT) pull )

gitstatus: 
	($(GIT) status)

